<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>商城首页</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript" src="${ctxScript}/shop/goods.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {

		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
<form:form id="searchForm" modelAttribute="goods" action="${ctx}/shop/index/" method="post" class="breadcrumb form-search">
	<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
	<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
	<ul class="ul-form">
		<li><label>商品名称：</label>
			<form:input path="name" htmlEscape="false" maxlength="80" class="input-medium"/>
		</li>

		<li><label>商品描述：</label>
			<form:input path="remarks" htmlEscape="false" maxlength="80" class="input-medium"/>
		</li>

		<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>

		<li class="btns">

			<input id="btnAdd" class="btn btn-yellow" style="background: #ffc266!important;" type="button" value="新增商品" onclick="editGoods('')"/>

		</li>

		<li class="clearfix"></li>
	</ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
	<thead>
	<tr>
		<th>商品名称</th>
		<th>更新时间</th>
		<th>商品描述</th>
		<th>商品价格</th>
		<shiro:hasPermission name="shop:goods:edit"><th>操作</th></shiro:hasPermission>
	</tr>
	</thead>
	<tbody>
	if(1231){
	123123
	}
	<c:if test="${page.list.size()>0}">
		<div style="color: red"> 1123123123 </div>
	</c:if>
	<c:forEach items="${page.list}" var="goods">
		<tr>
			<td>
				<a href="javascript:;" onclick="viewGoods('${goods.id}')">
					${goods.name}
			</a></td>
			<td>
				<fmt:formatDate value="${goods.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
			</td>
			<td>
					${goods.remarks}
			</td>

			<td>
				￥${goods.price}
			</td>

			<shiro:hasPermission name="shop:goods:edit"><td>
				<a href="javascript:;" onclick="editGoods('${goods.id}')">修改</a>

				<a href="javascript:;" onclick="viewGoods('${goods.id}')">查看</a>
				<a href="javascript:void(0);" onclick="viewGoods('${goods.id}')">查看</a>

				<a href="javascript:viewGoods('${goods.id}');">查看1</a>
			</td></shiro:hasPermission>
		</tr>
	</c:forEach>
	</tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>